package com.zhou.controller;

import com.zhou.service.OssService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

/**
 * @Description : 阿里云文件上传
 * @Author : zyy
 * @Date: 2024/6/12  14:33
 */
@RestController
@RequestMapping("OSS")
@CrossOrigin //跨域
public class OssController {
    @Autowired
    private OssService ossService;

    @PostMapping("oss/upload")
    public String upload(@RequestPart("file") MultipartFile file) {
        return ossService.upload(file);
    }
}
